package com.etc;

import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;
import java.util.Date;
import java.util.Map;
import java.util.Set;

@RunWith(SpringRunner.class)
@SpringBootTest(classes={EurekaClientRegApplication.class})// 指定启动类
//@SpringApplicationConfiguration(classes = Application.class)// 1.4.0 前版本
public class EurekaClientRegApplicationTests1 {



    @Resource(name="redisTemplate")
    RedisTemplate redisTemplate;

    @Test
    public void contextLoads() {
        ValueOperations<String, String> ops = redisTemplate.opsForValue();

        HashOperations<String, String, Object> hmops = redisTemplate.opsForHash();

        hmops.put("myobject", "name", "tom");
        hmops.put("myobject", "age", 10);
        hmops.put("myobject", "birthday", new Date());

        ops.set("mykey1", "hello");

    }





}
